package com.summer.filesync.model.manager;

import java.time.LocalDateTime;
import java.util.List;

/** 批量操作结果 */
public class BatchOperationResult {
  private boolean success;
  private int totalFiles;
  private int successCount;
  private int failureCount;
  private List<String> errors;
  private long totalSizeBytes;
  private long elapsedTimeMs;
  private LocalDateTime startTime;
  private LocalDateTime endTime;
  private String operationType;

  public BatchOperationResult(String operationType) {
    this.operationType = operationType;
    this.startTime = LocalDateTime.now();
    this.success = true;
  }

  public void complete() {
    this.endTime = LocalDateTime.now();
    this.elapsedTimeMs = java.time.Duration.between(startTime, endTime).toMillis();
  }

  // Getters and Setters
  public boolean isSuccess() {
    return success;
  }

  public void setSuccess(boolean success) {
    this.success = success;
  }

  public int getTotalFiles() {
    return totalFiles;
  }

  public void setTotalFiles(int totalFiles) {
    this.totalFiles = totalFiles;
  }

  public int getSuccessCount() {
    return successCount;
  }

  public void setSuccessCount(int successCount) {
    this.successCount = successCount;
  }

  public int getFailureCount() {
    return failureCount;
  }

  public void setFailureCount(int failureCount) {
    this.failureCount = failureCount;
  }

  public List<String> getErrors() {
    return errors;
  }

  public void setErrors(List<String> errors) {
    this.errors = errors;
  }

  public long getTotalSizeBytes() {
    return totalSizeBytes;
  }

  public void setTotalSizeBytes(long totalSizeBytes) {
    this.totalSizeBytes = totalSizeBytes;
  }

  public long getElapsedTimeMs() {
    return elapsedTimeMs;
  }

  public String getOperationType() {
    return operationType;
  }

  public LocalDateTime getStartTime() {
    return startTime;
  }

  public LocalDateTime getEndTime() {
    return endTime;
  }
}
